Optimal. Leaf size=81 \[ -\frac {2 \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {10 \tan (c+d x)}{3 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2845, 3057,
2827, 3852, 8, 3855} \begin {gather*} \frac {10 \tan (c+d x)}{3 a^2 d}-\frac {2 \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {2 \tan (c+d x)}{a^2 d (\cos (c+d x)+1)}-\frac {\tan (c+d x)}{3 d (a \cos (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2827
Rule 2845
Rule 3057
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx &=-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2}+\frac {\int \frac {(4 a-2 a \cos (c+d x)) \sec ^2(c+d x)}{a+a \cos (c+d x)} \, dx}{3 a^2}\\ &=-\frac {2 \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2}+\frac {\int \left (10 a^2-6 a^2 \cos (c+d x)\right ) \sec ^2(c+d x) \, dx}{3 a^4}\\ &=-\frac {2 \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2}-\frac {2 \int \sec (c+d x) \, dx}{a^2}+\frac {10 \int \sec ^2(c+d x) \, dx}{3 a^2}\\ &=-\frac {2 \tanh ^{-1}(\sin (c+d x))}{a^2 d}-\frac {2 \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2}-\frac {10 \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{3 a^2 d}\\ &=-\frac {2 \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {10 \tan (c+d x)}{3 a^2 d}-\frac {2 \tan (c+d x)}{a^2 d (1+\cos (c+d x))}-\frac {\tan (c+d x)}{3 d (a+a \cos (c+d x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(239\) vs. \(2(81)=162\).
time = 1.23, size = 239, normalized size = 2.95 \begin {gather*} \frac {2 \cos \left (\frac {1}{2} (c+d x)\right ) \left (\sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+14 \cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+6 \cos ^3\left (\frac {1}{2} (c+d x)\right ) \left (2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {\sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {c}{2}\right )\right )}{3 a^2 d (1+\cos (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 92, normalized size = 1.14
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d \,a^{2}}\) | \(92\) |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d \,a^{2}}\) | \(92\) |
norman | \(\frac {-\frac {9 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}+\frac {7 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}+\frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{6 a d}}{a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{2} d}-\frac {2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{2} d}\) | \(117\) |
risch | \(\frac {4 i \left (3 \,{\mathrm e}^{4 i \left (d x +c \right )}+9 \,{\mathrm e}^{3 i \left (d x +c \right )}+11 \,{\mathrm e}^{2 i \left (d x +c \right )}+12 \,{\mathrm e}^{i \left (d x +c \right )}+5\right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{a^{2} d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{a^{2} d}\) | \(125\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 145, normalized size = 1.79 \begin {gather*} \frac {\frac {\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a^{2}} + \frac {12 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a^{2}} + \frac {12 \, \sin \left (d x + c\right )}{{\left (a^{2} - \frac {a^{2} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.45, size = 146, normalized size = 1.80 \begin {gather*} -\frac {3 \, {\left (\cos \left (d x + c\right )^{3} + 2 \, \cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (\cos \left (d x + c\right )^{3} + 2 \, \cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - {\left (10 \, \cos \left (d x + c\right )^{2} + 14 \, \cos \left (d x + c\right ) + 3\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{3} + 2 \, a^{2} d \cos \left (d x + c\right )^{2} + a^{2} d \cos \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sec ^{2}{\left (c + d x \right )}}{\cos ^{2}{\left (c + d x \right )} + 2 \cos {\left (c + d x \right )} + 1}\, dx}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 106, normalized size = 1.31 \begin {gather*} -\frac {\frac {12 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac {12 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} + \frac {12 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a^{2}} - \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.41, size = 92, normalized size = 1.14 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{6\,a^2\,d}-\frac {4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^2\,d}-\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-a^2\right )}+\frac {5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a^2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________